# RT-Thread building script for component

Import('rtconfig')
import os
from building import *

CPPDEFINES = []
cwd = GetCurrentDir()
src = Split('''
Nuvoton/M451Series/Source/system_M451Series.c
''')
CPPPATH = [cwd + '/Nuvoton/M451Series/Include']
CPPPATH += [os.path.dirname(cwd) + '/CMSIS/Include']

#add for startup script 
if rtconfig.CROSS_TOOL == 'iar':
     src = src + ['Nuvoton/M451Series/Source/IAR/startup_M451Series.s']
elif rtconfig.CROSS_TOOL == 'keil':
     src = src + ['Nuvoton/M451Series/Source/ARM/startup_M451Series.s']
elif rtconfig.CROSS_TOOL == 'gcc':
     src = src + ['Nuvoton/M451Series/Source/GCC/startup_M451Series.s']

group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)

Return('group')
